﻿<UserControl x:Class="ViCode_LeVi.Controls.VMResultOfStep_Child"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:vmcontrol="clr-namespace:ViCode_LeVi.Controls"
        xmlns:Langs="clr-namespace:ViCode_LeVi.Langs"
        xmlns:Data="clr-namespace:ViCode_LeVi.Data" Background="WhiteSmoke" >
    <UserControl.Resources>
        <BooleanToVisibilityConverter  x:Key="BooleanToVisibilityConverter" />
    </UserControl.Resources>
    <StackPanel Name="StackPanel_Child"  DockPanel.Dock="Top" Orientation="Horizontal">        
        <Grid ToolTip="{Binding Source={x:Static Data:StepResult.StepResultItem_Bad}, Path=Description}">
            <Ellipse Fill="{Binding Source={x:Static Data:StepResult.StepResultItem_Bad}, Path=Color}" 
                                             Width="{Binding ElementName = Grid_RadioButton_Bad, Path = ActualWidth}"
                                             Height="{Binding ElementName = Grid_RadioButton_Bad, Path = ActualHeight}"
                                                 Visibility="{Binding ElementName = RadioButton_Bad, Path = IsChecked, Converter ={StaticResource BooleanToVisibilityConverter}}">
            </Ellipse>
            <Grid Name="Grid_RadioButton_Bad">
                <!--GroupName="CheckTab"-->
                <RadioButton Name="RadioButton_Bad" IsChecked="{Binding Is_StepResult_Bad}" Margin="5,2,2,2" 
                                                 Background="{Binding Source={x:Static Data:StepResult.StepResultItem_Bad}, Path=Color}"
                                                 ToolTip="{Binding Source={x:Static Data:StepResult.StepResultItem_Bad}, Path=Description}"/>
            </Grid>

        </Grid>

        <Grid ToolTip="{Binding Source={x:Static Data:StepResult.StepResultItem_Normal}, Path=Description}">
            <Ellipse Fill="{Binding Source={x:Static Data:StepResult.StepResultItem_Normal}, Path=Color}" 
                                             Width="{Binding ElementName = Grid_RadioButton_Normal, Path = ActualWidth}"
                                             Height="{Binding ElementName = Grid_RadioButton_Normal, Path = ActualHeight}"
                                                 Visibility="{Binding ElementName = RadioButton_Normal, Path = IsChecked, Converter ={StaticResource BooleanToVisibilityConverter}}">
            </Ellipse>
            <Grid Name="Grid_RadioButton_Normal">
                <!--GroupName="CheckTab"-->
                <RadioButton  Name="RadioButton_Normal" IsChecked="{Binding Is_StepResult_Normal}" Margin="5,2,2,2" 
                                                 Background="{Binding Source={x:Static Data:StepResult.StepResultItem_Normal}, Path=Color}"
                                                 ToolTip="{Binding Source={x:Static Data:StepResult.StepResultItem_Normal}, Path=Description}"/>
            </Grid>

        </Grid>

        <Grid ToolTip="{Binding Source={x:Static Data:StepResult.StepResultItem_Good}, Path=Description}">
            <Ellipse Fill="{Binding Source={x:Static Data:StepResult.StepResultItem_Good}, Path=Color}" 
                                             Width="{Binding ElementName = Grid_RadioButton_Good, Path = ActualWidth}"
                                             Height="{Binding ElementName = Grid_RadioButton_Good, Path = ActualHeight}"
                                                 Visibility="{Binding ElementName = RadioButton_Good, Path = IsChecked, Converter ={StaticResource BooleanToVisibilityConverter}}">
            </Ellipse>
            <Grid Name="Grid_RadioButton_Good">
                <!--GroupName="CheckTab"-->
                <RadioButton Name="RadioButton_Good" IsChecked="{Binding Is_StepResult_Good}" Margin="5,2,2,2" 
                                                 Background="{Binding Source={x:Static Data:StepResult.StepResultItem_Good}, Path=Color}"
                                                 ToolTip="{Binding Source={x:Static Data:StepResult.StepResultItem_Good}, Path=Description}"/>
            </Grid>

        </Grid>
    </StackPanel>
</UserControl>
